package com.atguigu.controller;

import com.atguigu.result.RetVal;
import com.atguigu.service.PaymentInfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 付款信息表 前端控制器
 * </p>
 *
 * @author Joe
 * @since 2024-12-08
 */
@Tag(name = "微信支付接口")
@RestController
@RequestMapping("api/payment/wxPay")
@Slf4j
public class PaymentInfoController {
    @Autowired
    private PaymentInfoService paymentInfoService;

    @Operation(summary = "微信下单并返回二维码")
    @PostMapping("createJsapi/{paymentType}/{orderNo}")
    public RetVal saveOrderAndDetail(@PathVariable String paymentType, @PathVariable String orderNo) {
        return paymentInfoService.saveOrderAndDetail(paymentType,orderNo);
    }
}
